package scjp.preparation.io;

import java.io.Console;

public class ConsoleTest {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		String username = null;
		char[] password = null;
		Console reader = System.console();
		if(reader != null) {
			username = reader.readLine("Enter username: ");
			password = reader.readPassword("Enter password: ");
			
			if(username.equals("yyermosh") && (new String(password)).equals("yy861264")) {
				reader.printf("Login is successful");
			}
		}
		

	}

}
